﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Bando.aspx.cs" Inherits="Bando" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <html>
    <head>
        <script type="text/javascript" src="http://www.vietbando.com/maps/API/VBDMapAPI.js?key=e7vjH+pgQHuSyV75dwG6hvLwz6qWeq9NhSklLUFfMG0="></script>
        <script type="text/javascript">
    function loadMap() 
    {
        if (VBrowserIsCompatible()) {
            var map = new VMap(document.getElementById('container'));
            map.setCenter(new VLatLng(10.8152328, 106.680505), 4);

            //cac dieu khien thuong dung tren ban do
            map.addControl(new VLargeMapControl());
            map.addControl(new VScaleControl());
            map.addControl(new VOverviewMapControl())

            var toado = <%= Load_Map() %>;
           
           for (var i = 0; i < toado.length; i++) 
           {
               var beach = toado[i];
               var pt = new VLatLng(beach[0], beach[1]);

               // thay doi icon
               var mopt = new VMarkerOptions(new VIcon("Image/ATM11.jpg", new VSize(32, 32)));
               var marker = new VMarker(pt, mopt);
               map.addOverlay(marker);   
           }

            VEvent.addListener(map, 'click', function (obj)
                {                 
                    var inforATM = '';    
                    if(obj.arrIndex == null)         
                    {
                        inforATM = '';
                    }
                    else
                    {
                        for(var j=0; j < toado.length; j++)                
                        {
                            if(obj.arrIndex == j)
                            {
                                var m_ToaDo = toado[j];    
                                inforATM = '<span style="color:#FF0000; font-size: 18px; font-weight: bold; margin-bottom:0" >' + m_ToaDo[2] + '</span>' + '<p style="color:#FFFF00 font-size: 16px; font-style:Italic" >' + m_ToaDo[3]+ '</p>';
                                var lkChitiet = '<a target="_blank" href="./Chitiet.aspx?MaATM=' + m_ToaDo[4] + '">Chi tiet</a>';
                            }                
                        }
                        var strHTML = inforATM + lkChitiet;
                        obj.openInfoWindow(strHTML);
                    }
                });
        }    
     }
         
        </script>
    </head>
        <body onload="loadMap()">
            <div id="container" style="height: 500px; position: relative; margin: 10px; border: 1px #b1c4d5 solid;">
            </div>
        </body>
    </html>
</asp:Content>
